using UnityEngine;
/// <summary>
/// 遗物逻辑基类
/// </summary>
public abstract class Relic
{
    public RelicData data { get; private set; }
    // 运行时引用，由 Manager 注入
    protected PlayerData player;
    protected EffectSystem effectSystem;
    protected BattleManager battleManager;
    public Relic(RelicData data)
    {
        this.data = data;
    }

    public void Initialize(PlayerData owner, EffectSystem es, BattleManager bm)
    {
        player = owner;
        effectSystem = es;
        battleManager = bm;
    }
    // === 核心生命周期钩子 ===

    /// <summary>
    /// 战斗开始时触发
    /// </summary>
    public virtual void OnBattleStart() { }

    /// <summary>
    /// 回合开始时触发
    /// </summary>
    public virtual void OnTurnStart() { }

    /// <summary>
    /// 玩家回合结束时触发
    /// </summary>
    public virtual void OnTurnEnd() { }

    /// <summary>
    /// 玩家使用卡牌后触发
    /// </summary>
    public virtual void OnPlayerUsedCard(Card card) { }

    /// <summary>
    /// 获得格挡时触发 (需要订阅 EffectSystem)
    /// </summary>
    public virtual void OnBlockGained(ITarget target, int amount) { }
    // 辅助方法：触发遗物闪烁动画 预留给UI
    protected void Flash()
    {
        Debug.Log($"[Relic] {data.name} 触发了效果！");
        // TODO: 通知 RelicUI 播放闪烁动画
    }
}